package com.subsequent.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsequent.pojo.Pharmacies;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;

@Mapper
public interface PharmaciesMapper extends BaseMapper<Pharmacies> {
    // 分页查询
    List<Pharmacies> selectPharmaciesByCondition(
        @Param("pharmacyName") String pharmacyName,
        @Param("pharmacyType") String pharmacyType,
        @Param("status") Integer status,
        @Param("startTime") Date startTime,
        @Param("endTime") Date endTime,
        @Param("offset") int offset,
        @Param("pageSize") int pageSize
    );

    // 统计总数
    int countPharmaciesByCondition(
        @Param("pharmacyName") String pharmacyName,
        @Param("pharmacyType") String pharmacyType,
        @Param("status") Integer status,
        @Param("startTime") Date startTime,
        @Param("endTime") Date endTime
    );

    // 获取所有药房类型（去重）
    List<String> selectAllPharmacyTypes();
}